#ifndef _HCC_ERROR_CODE_DRV_IDP_H_
#define _HCC_ERROR_CODE_DRV_IDP_H_

#include "ofc_types.h"
#include "hcc_error_code.h"
#include "hcc_error_code_drv.h"

#ifdef __cplusplus
extern "C" {
#endif

// 不含行号的错误码生成
#define HCC_MAKE_DRV_IDP_ERROR(error_code) (int)HCC_MAKE_DRIVER_ERROR(kHccDrvIdp, error_code, HCC_ERROR_LEVEL_ERROR)
// 含行号的错误码生成
#define HCC_MAKE_DRV_IDP_ERROR_LINE(error_code) (int)HCC_ERROR(HCC_MAKE_DRIVER_ERROR(kHccDrvIdp, error_code, HCC_ERROR_LEVEL_ERROR))


/**
 * IDP层公共驱动:IDP层公共驱动
 */
enum THccDrvIdpTag
{
	kHccDrvIdpSuccess	=	HCC_ERROR_SUCCESS,			///< 成功,没有错误
	kHccDrvIdpParam	=	HCC_MAKE_DRV_IDP_ERROR(0),			///<参数错误
	kHccDrvIdpComm	=	HCC_MAKE_DRV_IDP_ERROR(1),			///<通讯错误
	kHccDrvIdpCallBack	=	HCC_MAKE_DRV_IDP_ERROR(2),			///<回调函数未设置
	kHccDrvIdpNoExist	=	HCC_MAKE_DRV_IDP_ERROR(3),			///<设备不存在
	kHccDrvIdpNotSupport	=	HCC_MAKE_DRV_IDP_ERROR(4),			///<类型不支持
	kHccDrvIdpOutOfRange	=	HCC_MAKE_DRV_IDP_ERROR(5),			///<超出范围
	kHccDrvIdpOpened	=	HCC_MAKE_DRV_IDP_ERROR(6),			///<设备已打开
	kHccDrvIdpClosed	=	HCC_MAKE_DRV_IDP_ERROR(7),			///<设备已关闭
	kHccDrvIdpBaudRate	=	HCC_MAKE_DRV_IDP_ERROR(8),			///<波特率不合法
	kHccDrvIdpLastUnFinished	=	HCC_MAKE_DRV_IDP_ERROR(9),			///<上一次动作未完成
	kHccDrvIdpFail	=	HCC_MAKE_DRV_IDP_ERROR(10),			///<操作失败
	kHccDrvIdpNotAligned	=	HCC_MAKE_DRV_IDP_ERROR(11),			///<边界未对齐
	kHccDrvIdpTimeout	=	HCC_MAKE_DRV_IDP_ERROR(12),			///<处理超时
	kHccDrvIdpLock	=	HCC_MAKE_DRV_IDP_ERROR(13),			///<获取锁失败
	kHccDrvIdpPartitonAddr	=	HCC_MAKE_DRV_IDP_ERROR(14),			///<分区表首地址错误
	kHccDrvIdpCrc	=	HCC_MAKE_DRV_IDP_ERROR(15),			///<CRC校验错误
	kHccDrvIdpMem	=	HCC_MAKE_DRV_IDP_ERROR(16),			///<内存溢出
};
typedef enum THccDrvIdpTag THccDrvIdp;


typedef Int32 THccDrvIdpLine;
#define kHccDrvIdpSuccessLine	HCC_ERROR_SUCCESS	///< 成功,没有错误
#define kHccDrvIdpParamLine	HCC_MAKE_DRV_IDP_ERROR_LINE(0)	///<参数错误
#define kHccDrvIdpCommLine	HCC_MAKE_DRV_IDP_ERROR_LINE(1)	///<通讯错误
#define kHccDrvIdpCallBackLine	HCC_MAKE_DRV_IDP_ERROR_LINE(2)	///<回调函数未设置
#define kHccDrvIdpNoExistLine	HCC_MAKE_DRV_IDP_ERROR_LINE(3)	///<设备不存在
#define kHccDrvIdpNotSupportLine	HCC_MAKE_DRV_IDP_ERROR_LINE(4)	///<类型不支持
#define kHccDrvIdpOutOfRangeLine	HCC_MAKE_DRV_IDP_ERROR_LINE(5)	///<超出范围
#define kHccDrvIdpOpenedLine	HCC_MAKE_DRV_IDP_ERROR_LINE(6)	///<设备已打开
#define kHccDrvIdpClosedLine	HCC_MAKE_DRV_IDP_ERROR_LINE(7)	///<设备已关闭
#define kHccDrvIdpBaudRateLine	HCC_MAKE_DRV_IDP_ERROR_LINE(8)	///<波特率不合法
#define kHccDrvIdpLastUnFinishedLine	HCC_MAKE_DRV_IDP_ERROR_LINE(9)	///<上一次动作未完成
#define kHccDrvIdpFailLine	HCC_MAKE_DRV_IDP_ERROR_LINE(10)	///<操作失败
#define kHccDrvIdpNotAlignedLine	HCC_MAKE_DRV_IDP_ERROR_LINE(11)	///<边界未对齐
#define kHccDrvIdpTimeoutLine	HCC_MAKE_DRV_IDP_ERROR_LINE(12)	///<处理超时
#define kHccDrvIdpLockLine	HCC_MAKE_DRV_IDP_ERROR_LINE(13)	///<获取锁失败
#define kHccDrvIdpPartitonAddrLine	HCC_MAKE_DRV_IDP_ERROR_LINE(14)	///<分区表首地址错误
#define kHccDrvIdpCrcLine	HCC_MAKE_DRV_IDP_ERROR_LINE(15)	///<CRC校验错误
#define kHccDrvIdpMemLine	HCC_MAKE_DRV_IDP_ERROR_LINE(16)	///<内存溢出

#ifdef __cplusplus
}  // extern "C"
#endif

#endif // _HCC_ERROR_CODE_DRV_IDP_H_
/**
 * @
 */
